#pragma once

#if defined (_MSC_VER)
#   ifdef EXCEL_EXPORTS
#       define _ExcelExport __declspec(dllexport)
#   else
#       define _ExcelExport __declspec(dllimport)
#       ifdef CPPX_USE_AUTOLINK
#           pragma comment(lib,GET_CPPX_LIB_NAME(cppx.report.excel))
#           pragma message("Linking to lib file: " GET_CPPX_LIB_NAME(cppx.report.excel))
#       endif // CPPX_USE_AUTOLINK
#   endif
#endif // _MSC_VER

//////////////////////////////////////////////////////////////////////////
#include <boost/scoped_ptr.hpp>
#include <string>
using std::string;

class _ExcelExport ExcelReport
{
	struct pimpl_t;
	boost::scoped_ptr<pimpl_t> pimpl_;

public:
    ExcelReport(void);
    ~ExcelReport(void);

    void LoadTemplate(const char * tpl_name);
    void LoadSheet(const char * sheet_name);
    void MergeCells(int left,int top,int right,int bottom);
    void SetItemText(int nItem, int nSubItem, const char * value);
    void SetItemText(int nItem, const string & pSubItem, const string & value);
    void SaveExcel(const char * path);
    void ShowExcel(void);
    void PrintPreview(void);
    void AutoFit(void);
    string GetItemText(int nItem, int nSubItem);
    string GetItemText(int nItem, const string & pSubItem);
};
